# dict1 = {str(x) + '的二次方是': x ** 2 for x in range(1, 9)}
# print(dict1)
#
att = ['name', 'age', 'hobby']
val = ['zhangsan', 18, ['eat', 'sleep', 'beat doudou']]

stu1 = {
    x: y for x in att for y in val
}
print(stu1)
# ---------------字典推导-------------------
dict1 = {
    str(x) + '的平方是:': x ** 2 for x in range(1, 11)
}

print(dict1)

att = ['name', 'age', 'hobby']
val = ['zhangsan', 18, ['eat', 'sleep', 'beat doudou']]

print('-------zip----', zip(att, val))
for i in zip(att, val):
    print(i)
for i, j in zip(att, val):
    print(i, j)
stu1 = {
    x: y for x, y in zip(att, val)
}

print(stu1)

#  拆包
a = 1, 2, 3
# a, b = 1, 2, 3  # ValueError: too many values to unpack (expected 2)
